package com.xuhuan.example.example064;

/**
 * @author: huan.xu
 * @create: 2023/11/14 11:04
 * @description:
 **/
public class TypeChooser {

    public static ImageSaver getSaver(String type) {
        if ("GIF".equalsIgnoreCase(type)) {
            return new GIFSaver();
        } else if ("JPEG".equalsIgnoreCase(type)) {
            return new JPEGSaver();
        } else if ("PNG".equalsIgnoreCase(type)) {
            return new PNGSaver();
        }
        return null;

    }
}
